<template>
  <div>
    <button v-on:click="sayHello()">点击</button>
    <button @click="sayHello('Vue')">简写</button>
    <!-- 推荐 -->
  </div>
</template>

<script>
export default {
  methods: {
    sayHello(name = 'World') {
      alert(`Hello ${name}`);
    },
  },
};
</script>
